package com.qinghuan.designMode.prePrinciple.singleResponsibility;

/**
 * @Auther: qinghuan
 * @Date: 2022/2/16 19:31
 * @Description: 单一设计原则
 * 弊端：一个方法做很多没有关系性的事情，看起来很累赘，且逻辑也可能有错
 */
public class singleResponsibility1 {

    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("汽车");
        vehicle.run("飞机");

    }

}

class Vehicle{
    public void run(String vehicle) {
        System.out.println(vehicle + "在路上跑");
    }
}
